package com.swgk.core.view.selection;

import android.text.TextUtils;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class CommonPopEntity implements IPickerViewData, Serializable {
    @SerializedName(value = "no", alternate = {"key"})
    private String no;
    @SerializedName(value = "typeName", alternate = {"label", "name", "cname", "val", "value", "ranges", "serviceClass"})
    private String typeName;
    private String updateUser;
    private long updateTime;
    private String iconUrl;
    @SerializedName(value = "id", alternate = {"cid"})
    private String id;
    private String parentNo;
    private int sort;
    @SerializedName(value = "children", alternate = {"itemCatDTOList", "child", "childrenVO", "carLenList","childList"})
    private List<CommonPopEntity> children;
    private String categoryName;

    private int curPos;
    private String code;
    private boolean isChecked = false;

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public String getCategoryName() {
        if (TextUtils.isEmpty(categoryName)){
            categoryName = typeName;
        }
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public int getCurPos() {
        return curPos;
    }

    public void setCurPos(int curPos) {
        this.curPos = curPos;
    }

    public String getParentNo() {
        return parentNo;
    }

    public void setParentNo(String parentNo) {
        this.parentNo = parentNo;
    }

    public CommonPopEntity() {
    }

    public CommonPopEntity(String no, String typeName) {
        this.no = no;
        this.typeName = typeName;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Override
    public String getPickerViewText() {
        return this.typeName;
    }

    public List<CommonPopEntity> getChildren() {
        return children;
    }

    public void setChildren(List<CommonPopEntity> children) {
        this.children = children;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
